package ui;

import data.Node;
import logic.GraphGenerator;
import logic.GraphProcessing;
import logic.GraphProcessing.BreadthFirstIterator;

public class testBreathFirst {
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		
		GraphGenerator.Graph graph = GraphGenerator.Graph.load("graph10.txt");
		
		System.out.println(graph);
		
		Node focusNode = graph.getNodeList().get(0);//(int)(Math.random()*graph.getNodeList().size()));
		System.out.println("================generate tree with focus node "+focusNode.getID()+"===============");
		GraphProcessing gp = new GraphProcessing();
		gp.generateTree(focusNode);
		BreadthFirstIterator bfi = gp.iteratorBreadthFirst();
		int counter = 0;
		while (bfi.hasNextGeneration()){
			System.out.println("_____________generation "+counter+"______________");
			//LinkedList<Node>generation = bfi.nextGeneration();
			while(bfi.hasNext()){
				System.out.println(bfi.next().toString());
			}
			counter++;
		}
	}

}